home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk1
/
dnet
/
doc
/
source.doc
< prev
next >
Wrap
Text File
|
1995-03-18
|
3KB
|
82 lines
SOURCE ORGANIZATION
UNIX/AMIGA DIFFERENCES:
Essentially rewritten between the two, but major modules still do
the same thing. The UNIX source has an addition file, FILES.C,
which contains the routines normally associated with DNET.C on the
Amiga side.
CONTROL RECEIVE STAGE DECODE: Decode incomming packets providing
packet level commands (PKCMD), then demux PKCMD_WRITE
packets that are ready in order and execute corresponding
SCMD_???? commands
TRANSMIT STAGE ENCODE: Encode data queued by various
channels into packets, First by multiplexing SCMD_????
commands queued on TxList, then by generating PKCMD_???
packets.
PKCMD packets: WRITE DATA packet
CHECK Did window X make it over there?
(get ACK or NAK response)
ACK ACK a window
NAK NAK a window
RESTART RESTART DNET
ACKRSTART Acknowledge a restart
SCMD packets: SWITCH switch channel # (multiplexer)
for DATA packets
OPEN open a new connection (contains
the channel to use)
CLOSE close a connection (channel)
ACKCMD acknowledge an OPEN. Responses
are (a) channel in use, try a
different channel
(b) channel now open
(c) port does not exist
EOFCMD EOF on channel without closing
it (not supported by UNIX end)
QUIT Cause DNET server to exit when
received
DATA DATA destined for some channel.
DNET
(UNIX: FILES.C)
Handles talking to the clients.
GLOBALS Global variables
NET The raw network. On the Amiga end, it opens the device
and sets up two requests (CMD_READ/CMD_WRITE). On the
unix end, has that + NetRead/NetWrite calls.
SUBS Subroutines and support.
MULTIPLEXED PROTOCOL BASIS:
All SCMD_???? commands are based on a CHANNEL #, which is separate
from the PORT # (used only when openning a new connection). The
channel number is the multiplexer channel for a connection. Most
SCMD commands except SCMD_DATA have some sort of channel id. The only
possibility of channel allocation collision occurs in SCMD_OPEN, in
which case the receiver can send a SCMD_ACKCMD with a 'retry' error
code. Channel allocation is based on a random number generator.
PRIORITY:
Each channel has an associated priority. The priority determines
the packet size in a relative manner (that is, a channel with
priority -126 is no faster than a channel with +126 when it is
the only thing running).
The physical packet size is reduced when both a high priority and
a low priority channel is active at the same time. Otherwise, there
would be a 30 second delay typing characters from a TERM when a
file transfer is going on in the background. If you stop typing in
the TERM you will notice the packet size (as per Rx and Tx l.e.d's on
your modem) slowly increases for the file transfer.